import request from '@/utils/request'

export function add(data) {
  return request({
    url: 'api/projectInit',
    method: 'post',
    data
  })
}

export function del(ids) {
  return request({
    url: 'api/projectInit/',
    method: 'delete',
    data: ids
  })
}

// export function edit(data) {
//   return request({
//     url: 'api/projectInit',
//     method: 'put',
//     data
//   })
// }

// 更新项目策划人
export function edit(data) {
  return request({
    url: 'api/projectInit/updateProjAssistAndPlanner',
    method: 'put',
    data
  })
}

// 同步获取项目合同信息
export function fetchProjContract(params) {
  return request({
    url: 'api/syncProjectContract/fetchProjectContract',
    method: 'get',
    params
  })
}

// 手动更新接口
export function fetchIncrementProjContract(params) {
  return request({
    url: 'api/syncProjectContract/fetchIncrementProjContract',
    method: 'get',
    params
  })
}

// 新建项目查看可选策划人
export function projPlannerOption(params) {
  return request({
    url: 'api/projectInit/projPlannerOption',
    method: 'get',
    params
  })
}

export default { add, edit, del, fetchProjContract, projPlannerOption, fetchIncrementProjContract }
